Java Program To Find Minimum Insertions To Form A Palindrome | DP-28
Given string str, the task is to find the minimum number of characters to be inserted to convert it to a palindrome....
read more
Minimum count of prefixes and suffixes of a string required to form given string
Given two strings str1 and str2, the task is to find the minimum number of prefixes and suffixes of str2 required to form the string str1. If the task is not possible, return “-1”....
read more
Longest subsequence possible that starts and ends with 1 and filled with 0 in the middle
Given a binary string s, the task is to find the length of the longest subsequence that can be divided into three substrings such that the first and third substrings are either empty or filled with 1 and the substring at the middle is either empty or filled with 0....
read more
Longest Common Subsequence of two arrays out of which one array consists of distinct elements only
Given two arrays firstArr[], consisting of distinct elements only, and secondArr[], the task is to find the length of LCS between these 2 arrays....
read more
Maximum number of envelopes that can be put inside other bigger envelopes
Given N number of envelopes, as {W, H} pair, where W as the width and H as the height. One envelope can fit into another if and only if both the width and height of one envelope is greater than the width and height of the other envelope. Find the maximum number of envelopes that can be put inside another envelope and so on. Rotation of envelope is not allowed....
read more
Weird Number
In number theory, a weird number is a natural number that is abundant but not semiperfect. In other words, the sum of the proper divisors (divisors including 1 but not itself) of the number is greater than the number, but no subset of those divisors sums to the number itself. Given a number N, the task is to check if the number is weird or not....
read more
Maximum and Minimum Values of an Algebraic Expression
Given an algebraic expression of the form (x1 + x2 + x3 + . . . + xn) * (y1 + y2 + . . . + ym) and (n + m) integers. Find the maximum and minimum value of the expression using the given integers....
read more
Understanding The Coin Change Problem With Dynamic Programming
The Coin Change Problem is considered by many to be essential to understanding the paradigm of programming known as Dynamic Programming. The two often are always paired together because the coin change problem encompass the concepts of dynamic programming. For those who don’t know about dynamic programming it is according to Wikipedia,...
read more
Goldman Sachs Interview Experience | Campus drive for summer internship 2021 – IIT(BHU)
The process consisted of 1 online coding round , 3  tech interview rounds and 1 HR interview round....
read more
How Does Dynamic Programming Work?
Dynamic programming, popularly known as DP, is a method of solving problems by breaking them down into simple, overlapping subproblems and then solving each of the subproblems only once, storing the solutions to the subproblems that are solved to avoid redundant computations. This technique is useful for optimization-based problems, where the goal is to find the most optimal solution among all possible set of solutions....
read more
Find sum of all unique elements in the array for K queries
Given an arrays arr[] in which initially all elements are 0 and another array Q[][] containing K queries where every query represents a range [L, R], the task is to add 1 to each subarrays where each subarray is defined by the range [L, R], and return sum of all unique elements.Note: One-based indexing is used in the Q[][] array to signify the ranges.Examples:...
read more
Maximum Sum Alternating Subarray
Given an array arr[] of size N, the task is to find the maximum alternating sum of a subarray possible for a given array....
read more